package com.huawei.bitfun.bean;

import java.util.Map;
import java.util.Objects;

public class DebugLocBean {
    private String file;
    private Integer line;
    private Integer column;

    public DebugLocBean(String file, Integer line, Integer column) {
        this.file = file;
        this.line = line;
        this.column = column;
    }

    public DebugLocBean(Map<?, ?> map) {
        this.file = (String) map.get("File");
        this.line = (Integer) map.get("Line");
        this.column = (Integer) map.get("Column");
    }

    public Integer getColumn() {
        return column;
    }

    public Integer getLine() {
        return line;
    }

    public String getFile() {
        return file;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object == null || getClass() != object.getClass()) {
            return false;
        }
        DebugLocBean that = (DebugLocBean) object;
        return Objects.equals(file, that.file) && Objects.equals(line, that.line) && Objects.equals(column, that.column);
    }

    @Override
    public int hashCode() {
        return Objects.hash(file, line, column);
    }
}